package com.iflytek.hive.need7;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class MaxDayMapper extends Mapper<LongWritable, Text, DayAmountBean, NullWritable> {
    private final DayAmountBean keyOut = new DayAmountBean();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        // 将行文本数据切分
        String[] fields = value.toString().split(",");
        keyOut.set(fields[0],Double.valueOf(fields[1]));
        context.write(keyOut, NullWritable.get());
    }

}
